package com.hankkin.reading.http.api

import com.zhsm.fuxi.bean.*
import com.zhsm.paipaiout.baselibrary.common.BaseResponse
import io.reactivex.Observable
import retrofit2.http.*

interface PaipiaApi {

    /**---------------------userControl-----------------------**/
    //APP版本检查
    @GET("support/versions/inspect")
    fun checkVersion(@QueryMap map: HashMap<String, Any>): Observable<BaseResponse<CheckVersionResp?>>

    //获取七牛云上传令牌
    @GET("storage/qiniu/token")
    fun getQiniuToken(@QueryMap map: HashMap<String, Any>): Observable<BaseResponse<GetQiniuToken?>>

    //客户注册设备编号
    @POST("support/devices/register")
    fun postRegisterId(@QueryMap map: HashMap<String, Any>): Observable<BaseResponse<String?>>

    //获取登录图片验证码
    @GET("support/captcha/image")
    fun getImageCode(@Query("mobile") mobile: String): Observable<BaseResponse<String?>>

    //发送登录短信验证码
    @POST("support/captcha/mobile")
    fun sendSmsCode(@QueryMap map: HashMap<String, Any>): Observable<BaseResponse<String?>>

    //用户短信验证码登录
    @POST("customers/login")
    fun userLogin(@QueryMap map: HashMap<String, Any>): Observable<BaseResponse<UserBean>>

    //用户注销登录
    @POST("customers/{customerId}/logout")
    fun loginOut(@Path("customerId") customerId: Long): Observable<BaseResponse<String?>>

    //用户修改邮箱
    @POST("customers/{customerId}/modify/email")
    fun changeEmail(@Path("customerId") customerId: Long, @Query("email") email: String): Observable<BaseResponse<String?>>

    //用户修改电话号码
    @POST("customers/{customerId}/modify/mobile")
    fun changePhone(@Path("customerId") customerId: Long, @Query("mobile") mobile: String): Observable<BaseResponse<String?>>

    //用户修改昵称
    @POST("customers/{customerId}/modify/nick")
    fun changeNick(@Path("customerId") customerId: Long, @Query("nick") nick: String): Observable<BaseResponse<String?>>

    //用户修改头像
    @POST("customers/{customerId}/modify/icon")
    fun changeHeadPhoto(@Path("customerId") customerId: Long, @Query("icon") icon: String): Observable<BaseResponse<String?>>

    //根据客户ID查询客户概要信息
    @GET("customers/{customerId}/profile")
    fun updateUserInfo(@Path("customerId") customerId: Long): Observable<BaseResponse<UserBean?>>

    //分页查询用户订单列表
    @GET("customers/{customerId}/orders")
    fun getOrdeList(@Path("customerId") customerId: Long,@Query("pageNum") page:Int): Observable<BaseResponse<OrderListResp?>>


    /**---------------------att-----------------------**/
    //用户证照认证-证件信息提交
    @POST("authentication/credentials/customer/submit")
    fun upAttInfo(@QueryMap map: HashMap<String, Any>): Observable<BaseResponse<UserBean?>>

    //查询用户认证信息审核反馈信息
    @GET("authentication/auditing/customer/message")
    fun attFailedReason(@Query("customerId") customerId: Long): Observable<BaseResponse<List<String>?>>

    //查询用户认证信息概要
    @GET("authentication/auditing/customer/summary")
    fun getAttInfo(@Query("customerId") customerId: Long): Observable<BaseResponse<AttInfoBean?>>

    /**---------------------pay-----------------------**/

    //用户认证押金冻结
    @POST("alipayPreAuth/credentials/customer/{customerId}/zhimaAuthAppFreeze")
    fun getZhimaAuthPath(@Path("customerId") customerId: Long): Observable<BaseResponse<PayOrderinfo?>>

    //订单支付
    @POST("pay/alipay")
    fun zfbOrderPay(@Query("orderId") customerId: Long): Observable<BaseResponse<PayOrderinfo?>>

    //支付宝支付
    @POST("depositPay/alipay")
    fun zfbCashPledgePay(@Query("customerId") customerId: Long): Observable<BaseResponse<PayOrderinfo?>>

    //用户认证押金冻结查询
    @POST("alipayPreAuth/credentials/customer/zhimaAuthAppFreezeQuery")
    fun freezeQuery(@Query("outOrderNo") outOrderNo: String): Observable<BaseResponse<Int?>>

    //支付宝支付结果查询
    @POST("pay/alipayQuery")
    fun alipayQuery(@Query("orderId") orderId: String): Observable<BaseResponse<Int?>>

    /**---------------------station-----------------------**/
    //根据站点ID查询站点图片列表
    @GET("stations/{stationId}/images")
    fun stationPics(@Path("stationId") stationId: String): Observable<BaseResponse<List<String>?>>

    //根据定位查询附近站点列表
    @GET("stations/nearby")
    fun getStations(@QueryMap map: HashMap<String, Any>): Observable<BaseResponse<List<StationBean>?>>

    //根据站点ID分页查询可用车辆列表
    @GET("vehicles/available")
    fun getCarList(@QueryMap map: HashMap<String, Any>): Observable<BaseResponse<CarListResp?>>

    /**---------------------mainProcess-----------------------**/
    //根据客户ID查询进行中的订单
    @GET("orders/running")
    fun getDoingOrder(@Query("customerId") customerId: Long): Observable<BaseResponse<OrderResp?>>

    //客户下发订单
    @POST("orders/build")
    fun createOrder(@QueryMap map: HashMap<String, Any>): Observable<BaseResponse<OrderResp?>>

    //订单取车
    @POST("orders/{orderId}/vehicle/take")
    fun takeCar(@Path("orderId") orderId: Long): Observable<BaseResponse<OrderResp?>>

    //客户取消订单
    @POST("orders/{orderId}/cancel")
    fun cancelTakeCar(@Path("orderId") orderId: Long): Observable<BaseResponse<String?>>

    //取车报备提交-外观
    @POST("orders/{orderId}/take/vehicle/reports/surface")
    fun postTakeCarSurface(@Path("orderId") orderId: Long,@QueryMap map: HashMap<String, Any>): Observable<BaseResponse<OrderResp?>>

    //取车报备提交-内饰
    @POST("orders/{orderId}/return/vehicle/reports/interior")
    fun postTakeCarInterior(@Path("orderId") orderId: Long,@QueryMap map: HashMap<String, Any?>): Observable<BaseResponse<OrderResp?>>

    //车辆控制-开门
    @POST("orders/{orderId}/vehicle/door/open")
    fun openCarDoor(@Path("orderId") orderId: Long): Observable<BaseResponse<OrderResp?>>


    //还车报备提交-外观
    @POST("orders/{orderId}/return/vehicle/reports/surface")
    fun postBackCarSurface(@Path("orderId") orderId: Long,@QueryMap map: HashMap<String, Any>): Observable<BaseResponse<OrderResp?>>

    //车辆控制-关门
    @POST("orders/{orderId}/vehicle/door/close")
    fun closeCarDoor(@Path("orderId") orderId: Long): Observable<BaseResponse<String?>>

//    //查询车辆还车故障信息
//    @GET("orders/{orderId}/vehicle/breakdowns")
//    fun getCarBreakdowns(@Path("orderId") customerId: Long): Observable<BaseResponse<List<String>?>>

    //订单还车
    @POST("orders/{orderId}/vehicle/return")
    fun backCar(@Path("orderId") orderId: Long,@QueryMap map: HashMap<String, Any>): Observable<BaseResponse<OrderResp?>>

    /**---------------------OrderInvoice-----------------------**/
    //查询开票历史列表
    @POST("invoice/{customerId}/pagedQueryCustomerOrdersForInvoice")
    fun getInvoiceOrder(@Path("customerId") customerId: Long,@Query("pageNum") page:Int): Observable<BaseResponse<OrderListResp?>>

    //查询开票金额
    @POST("invoice/orderInvoiceAmount")
    fun getInvoiceMoney(@QueryMap map: HashMap<String, Any>): Observable<BaseResponse<String?>>

    //开具企业发票
    @POST("invoice/buildInvoice")
    fun buildInvoice(@QueryMap map: HashMap<String, Any>): Observable<BaseResponse<InvoiceDetailResp?>>

    //查询开票历史列表
    @POST("invoice/{customerId}/orderInvoices")
    fun getInvoiceHistory(@Path("customerId") customerId: Long,@Query("pageNum") page:Int): Observable<BaseResponse<InvoiceHistoryResp?>>

  //查询发票详情
    @POST("invoice/orderInvoiceDetail")
    fun getInvoiceDetails(@QueryMap map: HashMap<String, Any>): Observable<BaseResponse<InvoiceDetailResp?>>


}